﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace VNSoft
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        Administrator.clsXuLy cls = new Administrator.clsXuLy();
        public string Host = System.Configuration.ConfigurationSettings.AppSettings["Host"].ToString();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lbMenu.Text = "";
                DataTable dtMenu = cls.GetData("cl_GetMenu");
                if (dtMenu.Rows.Count > 0)
                {
                    lbMenu.Text += "<div class=\"nav\"><ul>";
                    for(int i=0;i<dtMenu.Rows.Count;i++)
                    {
                        lbMenu.Text += "<a href=\"" +Host+ dtMenu.Rows[i]["Link"].ToString() + "\">";
                        lbMenu.Text += "<li><span style=\"padding-top: 7px;\">" + dtMenu.Rows[i]["Name"].ToString() + "</span></li>";
                        if(i!=dtMenu.Rows.Count-1)
                            lbMenu.Text += "<li><img style=\"height: 20px;\" src=\""+Host+"image/listimage.jpg\"></li>";
                        lbMenu.Text += "</a>";
                    }
                    lbMenu.Text += "</ul>";
                }
            }
        }
    }
}